<?php
class Application_Model_TipoConta extends Zend_Db_Table_Abstract
{
	// Table Name
	protected $_name = 'tipo_contas';
	// Primary Key
	protected $_primary = 'id_tipo_contas';
	
	// Insert
	public function insert(array $data)
	{
		return	parent::insert($data);
	}
	
	// Update
	public function update(array $data, $where)
	{
		return parent::update($data, $where);
	}
	
	// Delete
	public function delete($where)
	{
		return parent::delete($where);
	}
	
 	public function selectAll()
    {
      $select = $this->select();
      return $this->fetchAll($select);
    }
    public function selectRow($id)
    {
    	$select = $this->select()->setIntegrityCheck(false);
    	
    	$select->from(array('c' => $this->_name), array('c.id_tipo_contas','c.descricao'));
    	
    	$select->where('c.id_tipo_contas = ?',$id);
    	
    	return $this->fetchRow($select);
    }
}